using System.Collections.Generic;

namespace Engine.FileFormats3D.WR2TrafficFiles
{
    public class CrossingBlockManager
    {
        #region Public Fields

        public List<CrossingBlock> blocks;

        #endregion Public Fields

        #region Public Constructors

        public CrossingBlockManager()
        {
            blocks = new List<CrossingBlock>();
        }

        #endregion Public Constructors

        #region Public Methods

        public void AddCroosingBlock(CrossingBlock block)
        {
            for (int i = 0; i < this.blocks.Count; i++)
            {
                bool same = false;
                CrossingBlock cb = this.blocks[i];

                if (cb.splineIDs.Count == block.splineIDs.Count)
                {
                    same = true;
                    for (int i2 = 0; i2 < cb.splineIDs.Count; i2++)
                    {
                        if (cb.splineIDs[i2] != block.splineIDs[i2])
                        {
                            same = false;
                            break;
                        }
                    }
                }
                if (same)
                {
                    return;
                }
            }

            this.blocks.Add(block);
        }

        #endregion Public Methods
    }
}